from pymysql import Connection

conn = Connection(
    host='localhost',
    port=3306,
    user='root',
    password='050602',
    autocommit=True
)
print(conn.get_server_info())

cursor = conn.cursor()
conn.select_db('test2')
## 创建表
# cursor.execute("Create table test(id int primary key)")
## 查询数据
cursor.execute("Select * from bank_user")
results: tuple = cursor.fetchall()
for result in results:
    print(result)

## 插入数据
cursor.execute("Insert into bank_user values(112233, '王五', '123456')")
# conn.commit()
conn.close()
